<!DOCTYPE html>
<html>
<head>
  @include("/common/init.html"){}
  <script src="${baseStaticUrl}/js/util.js"></script>

</head>
<body>
@include("/common/commonunity_header.html",{title:'社区'}){}
<div class="layui-hide-xs">
@include("/common/commonTie.html",{title:'社区'}){}
</div>
<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8 content detail">
      <div class="fly-panel detail-box">
        <h1>${postDetail.title!}</h1>
        <div class="fly-detail-info">
          <!-- <span class="layui-badge">审核中</span> -->
          <span class="layui-badge layui-bg-green fly-detail-column">${postDetail.type_name!}</span>

          @if(postDetail.accept! == 1){
            <span class="layui-badge" style="background-color: #5FB878;">已结</span>
          @}else{
          	<span class="layui-badge" style="background-color: #999;">未结</span>
          @}
          @if(postDetail.sticky_post == 1){
          	<span class="layui-badge layui-bg-black">置顶</span>
          @}
          @if(postDetail.fine_post == 1){
          	<span class="layui-badge layui-bg-red">精帖</span>
          @}
          @if(global.isManage(loginAccount.id!)){
	          <div class="fly-admin-box" data-id="123">
	            <span class="layui-btn layui-btn-xs jie-admin" type="del">删除</span>
	            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="stick" rank="1">置顶</span>
	            <!-- <span class="layui-btn layui-btn-xs jie-admin" type="set" field="stick" rank="0" style="background-color:#ccc;">取消置顶</span> -->

	            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" rank="1">加精</span>
	            <!-- <span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" rank="0" style="background-color:#ccc;">取消加精</span> -->
	          </div>
          @}
          <span class="fly-list-nums">
            <a href="#comment"><i class="iconfont" title="回答">&#xe60c;</i> ${postDetail.replayCount!}</a>
            <i class="iconfont" title="人气">&#xe60b;</i> ${postDetail.hits!"0"}
          </span>
        </div>
        <div class="detail-about">
          <a href="${basePath}/my/u/${postDetail.user_id!}" class="fly-avatar">
              <img src="${postDetail.avatar}" alt="${postDetail.nickname}">
          </a>
          <div class="fly-detail-user">
            <a href="${basePath}/my/u/${postDetail.user_id!}" class="fly-link">
              <cite>${postDetail.nickname!}</cite>
              @if(global.isNotNullOrEmpty(postDetail.approve!)){
              	<i class="iconfont icon-renzheng" title="认证信息：${postDetail.approve!}"></i>
              @}
              <i class="layui-badge fly-badge-vip">${postDetail.levelname!}</i>
            </a>
            <span>${postDetail.c_time!,dateFormat="yyyy-MM-dd"}</span>
          </div>
          <div class="detail-hits" id="LAY_jieAdmin" data-id="${postDetail.id!}">
            <span style="padding-right: 10px; color: #FF7200">悬赏：${postDetail.gold!"0"}金币</span>
            @if(global.isNullOrEmpty(loginAccount.id!)){
            @}else if(global.isEqual(loginAccount.id!,postDetail.user_id!)){
            	@if(!global.isAccept(postDetail.id!)){
            	<span class="layui-btn layui-btn-xs jie-admin" type="edit"><a href="${basePath}/jie/edit/${postDetail.id!}">编辑此贴</a></span>
            	@}
            @}else if(global.isCollection(loginAccount.id!,postDetail.id!)){
            	<span class="layui-btn layui-btn-xs jie-admin layui-btn-danger " type="collect" data-type="Del">取消收藏</span>
            @}else{
            	<span class="layui-btn layui-btn-xs jie-admin " type="collect" data-type="Add">收藏</span>
            @}
          </div>
        </div>
        <epoch:content classValue="detail-body photos" id="${postDetail.id!}_content" content="${postDetail.content!}"></epoch:content>
      </div>

      <div class="fly-panel detail-box">
        <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
          <legend>回帖</legend>
        </fieldset>

        <ul class="jieda" id="jieda">
	        @if(global.isEmptyTypeList(replayList!)){
	          @for(item in replayList!){
	          <li data-id="${item.id!}" class="jieda-daan">
	            <a name="item-1111111111"></a>
	            <div class="detail-about detail-about-reply">
                  <a href="${basePath}/my/u/${item.user_id!}" class="fly-avatar">
                      <img src="${item.avatar}" alt="${item.nickname}">
	              </a>
	              <div class="fly-detail-user">
	                <a href="" class="fly-link">
	                  <cite>${item.nickname!}</cite>
	                  <i class="iconfont icon-renzheng" title="认证信息：${item.approve!}"></i>
	                  <i class="layui-badge fly-badge-vip">${item.level_name!}</i>
	                </a>
	                @if(global.isEqual(item.replay_user_id!,postDetail.user_id!)){
	                <span>(楼主)</span>
	                @}
	                <!--
	                <span style="color:#5FB878">(管理员)</span>
	                <span style="color:#FF9E3F">（社区之光）</span>
	                <span style="color:#999">（该号已被封）</span>
	                -->
	              </div>
	              <div class="detail-hits">
	                <epoch:ago id="${item.replay_time}_time" time="${item.replay_time!}"></epoch:ago>
	              </div>
	              	@if(item.accept! == 1){
	              	<i class="iconfont icon-caina" title="最佳答案"></i>
	            	@}
	            </div>
	            <epoch:content classValue="detail-body jieda-body photos" id="${item.id!}_content" content="${item.replay_text!}"></epoch:content>
	            <div class="jieda-reply">
	            	 @if(global.isZan(loginAccount.id!,item.id!)){
		              <span class="jieda-zan zanok" type="zan">
		                <i class="iconfont icon-zan"></i>
		                <em>${item.praise_count!"0"}</em>
		              </span>
		             @}else{
		             	<span class="jieda-zan" type="zan">
		                <i class="iconfont icon-zan"></i>
		                <em>${item.praise_count!"0"}</em>
		              </span>
		             @}
	              <span type="reply">
	                <i class="iconfont icon-svgmoban53"></i>
	                	回复
	              </span>
	              @if(global.isEqual(loginAccount.id!,item.user_id!)){
	              	  @if(!global.isAccept(postDetail.id!) && !global.isEqual(loginAccount.id!,item.replay_user_id!)){
			              <div class="jieda-admin">
			                <span class="jieda-accept" type="accept">采纳</span>
			              </div>
		              @}
	              @}
	            </div>
	          </li>
          	   @}
          @}else{
          <!-- 无数据时 -->
          	<li class="fly-none">消灭零回复</li>
          @}
        </ul>

        <div class="layui-form layui-form-pane">
          <form action="${basePath}/jie/reply" method="post">
            <div class="layui-form-item layui-form-text">
              <a name="comment"></a>
              <div class="layui-input-block">
                <textarea id="L_content" name="content" required lay-verify="required" placeholder="请输入内容"  class="layui-textarea fly-editor" style="height: 150px;"></textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <input type="hidden" name="jid" value="${postId!}">
              <button class="layui-btn" lay-filter="*" lay-submit>提交回复</button>
            </div>
          </form>
        </div>
      </div>
    </div>
    <div class="layui-col-md4">
      <dl class="fly-panel fly-list-one">
        <dt class="fly-panel-title">本周热议</dt>
        @for(item in weekHeatReplayList!){
	       	<dd>
	          <a href="${basePath}/jie/page/${item.id}">${item.title!}</a>
	          <span><i class="iconfont icon-pinglun1"></i>${item.count!}</span>
	        </dd>
         @}
      </dl>
    </div>
  </div>
</div>

<div class="layui-footer footer footer-index">
    <div class="layui-main">
        <p><a href="/">Epoch社区</a> © 2018</p>
        <p>
            |<a href="http://www.miitbeian.gov.cn" target="_blank"> 皖ICP备18002832号-1</a>
        </p>
    </div>
</div>
<script>
layui.cache.page = 'jie';
layui.cache.user = {
  username: '游客'
  ,uid: -1
  ,avatar: '../../res/images/avatar/00.jpg'
  ,experience: 83
  ,sex: '男'
};
layui.config({
  version: "3.0.0"
  ,base: '${baseStaticUrl}/mods/'
}).extend({
  fly: 'index'
}).use(['fly', 'face'], function(){
  var $ = layui.$
  ,fly = layui.fly;
});
</script>
</body>
</html>